import org.junit.Test;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class RateComparatorTest {
    PrintStream printStream;
    private List<Hotel> hotelList;

    @Test
    public void shouldDisplayCheapestHotelForGivenInput(){
        printStream = mock(PrintStream.class);
        hotelList = new ArrayList<Hotel>();
        hotelList.add(new Hotel("Lakewood", 3, 110, 80, 90, 80));
        hotelList.add(new Hotel("Bridgewood", 4, 160, 110, 60, 50));
        hotelList.add(new Hotel("Ridgewood", 5, 220, 100, 150, 40));
        RateComparator rateComparator = new RateComparator(printStream, hotelList);
        String input1 = "Regular: 16Mar2009(mon), 17Mar2009(tues), 18Mar2009(wed)";
        String input2 = "Regular: 20Mar2009(fri), 21Mar2009(sat), 22Mar2009(sun)";
        String input3 = "Rewards: 26Mar2009(thur), 27Mar2009(fri), 28Mar2009(sat)";

        rateComparator.compare(input1);
        verify(printStream).println("Lakewood");
        rateComparator.compare(input2);
        verify(printStream).println("Bridgewood");
        rateComparator.compare(input3);
        verify(printStream).println("Ridgewood");
    }


}
